package com.hkts.beltweigher.opc;

import com.hkts.beltweigher.salve.service.IEastBeltscalesInstantaneousdataService;
import com.hkts.beltweigher.salve.service.IEastBeltscalesMinitueService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;
import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.scheduling.annotation.Scheduled;

@Configuration
@EnableScheduling
public class Task {
    @Autowired
    public IEastBeltscalesInstantaneousdataService iEastBeltscalesInstantaneousdataService;

    @Autowired
    public IEastBeltscalesMinitueService iEastBeltscalesMinitueService;
    //1、处理实时数据 1秒钟更新一次
    //2、处理批次数据
    @Scheduled(cron = "0/1 * * * * ?")
    public void handlerInstantaneousdata(){
        iEastBeltscalesInstantaneousdataService.handlerInstantaneousdata();
    }

    //1、每分钟新增一条流量数据
    @Scheduled(cron = "0 0/1 * * * ?")
    public void handlerMinituedata(){
        iEastBeltscalesMinitueService.handlerMinituedata();
    }
}
